home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / hardware / kbdhand9 / key.doc < prev    next >
Text File  |  1994-06-15  |  3KB  |  56 lines

  1. INT9 (IRQ1) keyboard handler #9 by Patch (hamell@cs.pdx.edu)
  2. ───────────────────────────────────────────────────────────────────────────────
  3.                                                                 June 15th, 1994
  4.  
  5. Added a variable called KEYLAST so you could do input and build a string with
  6. the values in this variable.  toASCII is a translate table that it gets shifted
  7. and unshifted characters from and stores the result in KEYLAST.  The #define's
  8. that start with b are for BIOS equivalents (most of them are).  To get input
  9. in the normal manner of getch(), call GetKey.  The first key available from the
  10. keyboard buffer is stored in KEYLAST (0 means no key available).
  11.  
  12. You can change the toASCII table to match the hardware scan codes to ASCII
  13. codes.  As it is now only alphanumeric, Enter, and ESC are translated.  Keys
  14. such as F1-F12, Insert, etc. are translated to return 0.
  15.  
  16. Description of variables/functions/files
  17. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. keys[]         - Array of 256 bytes.  Each position corresponds to a key on the 
  19.                  keyboard.  A value of 1 means the key is being pressed, 0 means 
  20.                  released.  If you wanted to check for the LEFT SHIFT key being
  21.                  pressed, you'd type
  22.                    if (keys[kLEFTSHIFT] == 1) ...
  23. keynumpress    - Tells you the number of keys being pressed at any given time
  24.                  If you want to do something while waiting for a keypress, you 
  25.                  could do
  26.                            while (keynumpress == 0) ;
  27.                  or
  28.                            do GetKey(); while (keylast == 0);
  29.                  instead of
  30.                            while (!kbhit());
  31. keylast        - shifted value of last key hit
  32. Set_New_Int9() - Call this function when you want to install the INT 9 handler
  33. Set_Old_Int9() - Call this function when you want to uninstall the INT 9 handler
  34. ClearKeys      - clears the keyboard buffer
  35. GetKey         - returns the first key from the keyboard buffer in the variable
  36.                  KEYLAST (0 means no key available)
  37. KEY.DOC        - this doc file
  38. KEY.ASM        - ASM source for the INT9 handler (32-bit)
  39. KEY16.ASM      - ............................... (16-bit)
  40. KEY.H          - C #include header file (32-bit)
  41. KEY16.H        - ...................... (16-bit)
  42. KEY.OBJ        - compiled KEY.ASM
  43. KEY16.OBJ      - compiled KEY16.ASM
  44. KEYTEST.C      - C source for a program testing the INT9 handler
  45. KEYTEST.EXE    - executable (DOS/4GW required to run it)
  46.  
  47. If you and use it (whether it be as-is or slightly modified), please credit me.
  48. Please email me any changes you make so I can include them in future releases.
  49.  
  50. To get more similar source and/or grafx/sound source, call my board:
  51.  
  52.         Dead Man's Hand
  53.         (503) 288-9264
  54.         USR 28.8k DS
  55.         Grafx/sound programming and VGA demos
  56.